﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ExamInfo.aspx.cs" Inherits="ExamAnalysis.BasicInfo.ExamInfo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
        .x-grid-cell-fullName .x-grid-cell-inner {
            font-family : tahoma, verdana;
            display     : block;
            font-weight : normal;
            font-style  : normal;
            color       : #385F95;
            white-space : normal;
        }
        
        .x-grid-rowbody div {
            margin : 2px 5px 20px 5px !important;
            width  : 99%;
            color  : Gray;
        }
        
        .x-grid-row-expanded td.x-grid-cell{
            border-bottom-width:0px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:LinqDataSource ID="SchoolInfoLinqDataSource" runat="server" 
        ContextTypeName="ExamAnalysis.Model.ExamAnalysisDataContext" EntityTypeName="" 
        TableName="SchoolInfo">
    </asp:LinqDataSource>
        <asp:LinqDataSource ID="CourseInfoLinqDataSource" runat="server" 
        ContextTypeName="ExamAnalysis.Model.ExamAnalysisDataContext" EntityTypeName="" 
        TableName="CourseInfo">
    </asp:LinqDataSource>
    <ext:GridPanel 
            runat="server" 
            ID="ClassInfoGridPanel" 
            Height="220" 
            Width="600"
            Title="考试安排信息" 
            Frame="true">
            <Store>
                <ext:Store ID="Store2" runat="server" >
                    <Model>
                        <ext:Model ID="Model1" runat="server" Name="ClassInfo" IDProperty="CalendarID">
                            <Fields>
                                <ext:ModelField Name="CalendarID" />
                                <ext:ModelField Name="DisplayName" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel ID="ColumnModel2" runat="server" >
			    <Columns>                
                    <ext:Column ID="Column1" runat="server" DataIndex="DisplayName" Text="考试安排"  Width="200">
                    <Editor>
                         <ext:TextField ID="TextField1" runat="server" />
                    </Editor>
                    </ext:Column>
			    </Columns>
            </ColumnModel>    
            <SelectionModel>
              <ext:RowSelectionModel ID="RowSelectionModel3" runat="server" Mode="Single" />
             </SelectionModel>     
             <TopBar>
            <ext:Toolbar ID="Toolbar1" runat="server">
                <Items>
                </Items>
                </ext:Toolbar>
            </TopBar>
            <BottomBar>
                <ext:Toolbar ID="Toolbar6" runat="server">
                <Items>
                 <ext:Button ID="Button2" Text="添加考试安排" runat="server" OnDirectClick="Button2_Click" />
                 <ext:Button ID="Button3" Text="更改选中安排说明" runat="server" OnDirectClick="Button3_Click" />
                 <ext:Button ID="Button4" Text="删除考试安排" runat="server" OnDirectClick="Button4_Click" />
                 <ext:Button ID="Button7" Text="显示当日考试详情" runat="server" OnDirectClick="ShowExam_Click"/>
                 </Items>
                </ext:Toolbar>
                </BottomBar>
        </ext:GridPanel>
        <ext:Store 
            ID="Store3" 
            runat="server" 
            PageSize="1">
            <AutoLoadParams>
                <ext:Parameter Name="start" Value="0" Mode="Raw" />
            </AutoLoadParams>
            <Proxy>
                <ext:PageProxy />
            </Proxy>
            <Model>
                <ext:Model ID="Model2" runat="server" IDProperty="ExamID">
                    <Fields>
                        <ext:ModelField Name="ExamID" />
                        <ext:ModelField Name="ExamName" />
                        <ext:ModelField Name="CourseID"  />
                        <ext:ModelField Name="CourseCode"  />
                        <ext:ModelField Name="CourseName"  />
                    </Fields>
                </ext:Model>
            </Model>
            <Listeners>
                <DataChanged Handler="var record = this.getAt(0) || {};#{FormPanel1}.getForm().loadRecord(record);#{FormPanel1}.clearInvalid();" />
                <BeforeLoad Handler="#{FormWindow}.body.mask('Loading...', 'x-mask-loading');" />
                <Load Handler="#{FormWindow}.body.unmask();" />
                <Exception Handler="#{FormWindow}.body.unmask();" />
            </Listeners>
        </ext:Store>
        <ext:Window 
            ID="CalendarWindow" 
            runat="server" 
            Title="考试编辑" 
            Width="420" 
            Height="300"           
            BodyPadding="10" 
            Resizable="false" 
            Closable="True"
            Layout="Fit" AutoShow="False" HideCollapseTool="False" Hidden="True" HideMode="Visibility">
            <Items>
                <ext:FormPanel 
                    ID="FormPanel2" 
                    runat="server" 
                    Border="false" 
                    BodyStyle="background-color:transparent;"
                    DefaultAnchor="-10"
                    Layout="Form">
                    <Items>
                        <ext:TextField 
                            ID="DisplayName"
                            runat="server" 
                            Name="DisplayName" 
                            MsgTarget="Side" 
                            AllowBlank="false"
                            FieldLabel="安排详情" 
                            /> 
                            <ext:TextField 
                            ID="ExamName"
                            runat="server" 
                            Name="ExamName" 
                            MsgTarget="Side" 
                            AllowBlank="false"
                            FieldLabel="考试详情" 
                            />                 
                              
                        <ext:DropDownField ID="DropDownField3" runat="server" Width="400" FieldLabel="相关课程" Text="请选择">
                            <Component>
                                <ext:GridPanel ID="GridPanel4" Height="200" runat="server">
                                    <ColumnModel>
                                        <Columns> 
                                            <ext:Column ID="Column7" runat="server" Width="150" Text="课程编号" DataIndex="CourseCode" />
                                            <ext:Column ID="Column8" runat="server" Width="150" Text="课程名称" DataIndex="CourseName" /> 
                                        </Columns>
                                    </ColumnModel>
                                    <SelectionModel>
                                         <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" Mode="Multi" />
                                    </SelectionModel>
                                    <Store>
                                        <ext:Store ID="Store6" runat="server" DataSourceID="CourseInfoLinqDataSource">
                                            <Model>
                                                <ext:Model ID="Model6" runat="server" IDProperty="CourseID">
                                                    <Fields>
                                                        <ext:ModelField Name="CourseID" />
                                                        <ext:ModelField Name="CourseName" />
                                                        <ext:ModelField Name="CourseCode" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                    <BottomBar>
                                        <ext:Toolbar ID="Toolbar7" runat="server">
                                            <Items>
                                                <ext:Button ID="Button12" Text="选择" runat="server" OnDirectClick="Button_5_Click" />
                                            </Items>
                                        </ext:Toolbar>
                                    </BottomBar>
                                </ext:GridPanel>
                            </Component>
                        </ext:DropDownField>
                    </Items>
                </ext:FormPanel>
            </Items>
            <BottomBar>
        <ext:Toolbar ID="Toolbar4" runat="server">
                    <Items>
                        <ext:Button ID="Button9" runat="server" Icon="Add" Text="添加" Visible="true">
                          <DirectEvents>
                                <Click OnEvent="Add_Click" />
                           </DirectEvents>
                        </ext:Button>      
                         <ext:Button ID="Button10" runat="server" Icon="Accept" Text="更新" Visible="true">
                          <DirectEvents>
                                <Click OnEvent="Change_Click" />
                           </DirectEvents>
                        </ext:Button>              
                        <ext:ToolbarFill ID="ToolbarFill2" runat="server" /> 
                        <ext:Button ID="Button13" runat="server" Icon="Add" Text="添加" Visible="true">
                          <DirectEvents>
                                <Click OnEvent="Add2_Click" />
                           </DirectEvents>
                        </ext:Button>      
                         <ext:Button ID="Button14" runat="server" Icon="Accept" Text="更新" Visible="true">
                          <DirectEvents>
                                <Click OnEvent="Change2_Click" />
                           </DirectEvents>
                        </ext:Button>              
                        <ext:ToolbarFill ID="ToolbarFill1" runat="server" /> 
                    </Items>
                </ext:Toolbar>
            </BottomBar>
        </ext:Window>

        <ext:GridPanel runat="server" ID="GridPanel3" Title="当日考试" Height="200" Width="600" Frame="true" Hidden="true">
        <Store>
            <ext:Store ID="Store5" runat="server">
                <Model>
                    <ext:Model ID="Model5" runat="server" IDProperty="ExamID">
                        <Fields>
                            <ext:ModelField Name="ExamID" />
                            <ext:ModelField Name="ExamName" />
                            <ext:ModelField Name="CourseID" />
                            <ext:ModelField Name="CourseName" />
                        </Fields>
                    </ext:Model>
                </Model>
                        <listeners>                            
                                <Write Handler="Ext.Msg.alert('Success', 'The suppliers have been saved');" />
                            </listeners>
            </ext:Store>
    
        </Store>
        <Plugins>
            <ext:CellEditing ID="CellEditing1" runat="server" />
        </Plugins>
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:Column ID="Column2" runat="server" DataIndex="ExamName" Text="考试名称" Width="150">
                </ext:Column>
                <ext:Column ID="Column22" runat="server" DataIndex="ExamID" Text="考试编号" Width="150">
                </ext:Column>
            </Columns>
        </ColumnModel> 
        <SelectionModel>
              <ext:RowSelectionModel ID="RowSelectionModel5" runat="server" Mode="Single" />
             </SelectionModel>
        <BottomBar>
                <ext:Toolbar ID="Toolbar2" runat="server">
                <Items>
                 <ext:Button ID="Button5" Text="添加考试" runat="server" OnDirectClick="Button_2_Click" />
                 <ext:Button ID="Button6" Text="更改选中考试" runat="server" OnDirectClick="Button_3_Click" />
                 <ext:Button ID="Button11" Text="删除考试" runat="server" OnDirectClick="Button_4_Click" />
                 </Items>
                </ext:Toolbar>
                </BottomBar>      
    </ext:GridPanel>
</asp:Content>
